<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.3"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>FabGL: I2C Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen-awesome.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">FabGL
   </div>
   <div id="projectbrief">ESP32 Display Controller and Graphics Library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.3 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('classfabgl_1_1_i2_c.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classfabgl_1_1_i2_c-members.html">List of all members</a>  </div>
  <div class="headertitle"><div class="title">I2C Class Reference</div></div>
</div><!--header-->
<div class="contents">

<p><a class="el" href="classfabgl_1_1_i2_c.html" title="I2C class allows multiple tasks to communicate with I2C devices, serializing read/write jobs.">I2C</a> class allows multiple tasks to communicate with <a class="el" href="classfabgl_1_1_i2_c.html" title="I2C class allows multiple tasks to communicate with I2C devices, serializing read/write jobs.">I2C</a> devices, serializing read/write jobs.  
 <a href="classfabgl_1_1_i2_c.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="tsi2c_8h_source.html">tsi2c.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a93f66e29e22bca7a9f5d8e3d5af2d6a2"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfabgl_1_1_i2_c_a93f66e29e22bca7a9f5d8e3d5af2d6a2.html#a93f66e29e22bca7a9f5d8e3d5af2d6a2">I2C</a> (int bus=0)</td></tr>
<tr class="memdesc:a93f66e29e22bca7a9f5d8e3d5af2d6a2"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="classfabgl_1_1_i2_c.html" title="I2C class allows multiple tasks to communicate with I2C devices, serializing read/write jobs.">I2C</a> class constructor.  <a href="classfabgl_1_1_i2_c_a93f66e29e22bca7a9f5d8e3d5af2d6a2.html#a93f66e29e22bca7a9f5d8e3d5af2d6a2">More...</a><br /></td></tr>
<tr class="separator:a93f66e29e22bca7a9f5d8e3d5af2d6a2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abdd72a91fee181ca1b9eb05120e60a28"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfabgl_1_1_i2_c_abdd72a91fee181ca1b9eb05120e60a28.html#abdd72a91fee181ca1b9eb05120e60a28">begin</a> (gpio_num_t SDAGPIO, gpio_num_t SCLGPIO)</td></tr>
<tr class="memdesc:abdd72a91fee181ca1b9eb05120e60a28"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes <a class="el" href="classfabgl_1_1_i2_c.html" title="I2C class allows multiple tasks to communicate with I2C devices, serializing read/write jobs.">I2C</a> instance associating GPIOs to <a class="el" href="classfabgl_1_1_i2_c.html" title="I2C class allows multiple tasks to communicate with I2C devices, serializing read/write jobs.">I2C</a> signals.  <a href="classfabgl_1_1_i2_c_abdd72a91fee181ca1b9eb05120e60a28.html#abdd72a91fee181ca1b9eb05120e60a28">More...</a><br /></td></tr>
<tr class="separator:abdd72a91fee181ca1b9eb05120e60a28"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a798669caf759c63cfa1e67cfb9d35874"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfabgl_1_1_i2_c_a798669caf759c63cfa1e67cfb9d35874.html#a798669caf759c63cfa1e67cfb9d35874">getMaxBufferLength</a> ()</td></tr>
<tr class="memdesc:a798669caf759c63cfa1e67cfb9d35874"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns maximum size of read and write buffers.  <a href="classfabgl_1_1_i2_c_a798669caf759c63cfa1e67cfb9d35874.html#a798669caf759c63cfa1e67cfb9d35874">More...</a><br /></td></tr>
<tr class="separator:a798669caf759c63cfa1e67cfb9d35874"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aee6d332047f3429253a95c94c59cccd9"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfabgl_1_1_i2_c_aee6d332047f3429253a95c94c59cccd9.html#aee6d332047f3429253a95c94c59cccd9">read</a> (int address, uint8_t *buffer, int size, int frequency=100000, int timeOutMS=50)</td></tr>
<tr class="memdesc:aee6d332047f3429253a95c94c59cccd9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Receives a buffer from <a class="el" href="classfabgl_1_1_i2_c.html" title="I2C class allows multiple tasks to communicate with I2C devices, serializing read/write jobs.">I2C</a> bus.  <a href="classfabgl_1_1_i2_c_aee6d332047f3429253a95c94c59cccd9.html#aee6d332047f3429253a95c94c59cccd9">More...</a><br /></td></tr>
<tr class="separator:aee6d332047f3429253a95c94c59cccd9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5683609bed861f2c075c25d935029e3f"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfabgl_1_1_i2_c_a5683609bed861f2c075c25d935029e3f.html#a5683609bed861f2c075c25d935029e3f">write</a> (int address, uint8_t *buffer, int size, int frequency=100000, int timeOutMS=50)</td></tr>
<tr class="memdesc:a5683609bed861f2c075c25d935029e3f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sends a buffer to <a class="el" href="classfabgl_1_1_i2_c.html" title="I2C class allows multiple tasks to communicate with I2C devices, serializing read/write jobs.">I2C</a> bus.  <a href="classfabgl_1_1_i2_c_a5683609bed861f2c075c25d935029e3f.html#a5683609bed861f2c075c25d935029e3f">More...</a><br /></td></tr>
<tr class="separator:a5683609bed861f2c075c25d935029e3f"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p ><a class="el" href="classfabgl_1_1_i2_c.html" title="I2C class allows multiple tasks to communicate with I2C devices, serializing read/write jobs.">I2C</a> class allows multiple tasks to communicate with <a class="el" href="classfabgl_1_1_i2_c.html" title="I2C class allows multiple tasks to communicate with I2C devices, serializing read/write jobs.">I2C</a> devices, serializing read/write jobs. </p>
<p >A single instance of <a class="el" href="classfabgl_1_1_i2_c.html" title="I2C class allows multiple tasks to communicate with I2C devices, serializing read/write jobs.">I2C</a> class can be shared among multiple tasks or timers (not interrupts).</p>
<p >Example: </p><pre class="fragment">fabgl::I2C I2C;

void setup() {
  I2C.begin(GPIO_NUM_4, GPIO_NUM_15);  // 4 = SDA, 15 = SCL (WARN: disconnect VGA connector!!)
}
</pre> <dl class="section examples"><dt>Examples</dt><dd><a class="el" href="_s_s_d1306__o_l_e_d_2128x32_2_collision_detection_2_collision_detection_8ino-example.html#_a0">SSD1306_OLED/128x32/CollisionDetection/CollisionDetection.ino</a>, <a class="el" href="_s_s_d1306__o_l_e_d_2128x32_2_simple_terminal_out_2_simple_terminal_out_8ino-example.html#_a0">SSD1306_OLED/128x32/SimpleTerminalOut/SimpleTerminalOut.ino</a>, <a class="el" href="_s_s_d1306__o_l_e_d_2128x64_2_collision_detection_2_collision_detection_8ino-example.html#_a0">SSD1306_OLED/128x64/CollisionDetection/CollisionDetection.ino</a>, <a class="el" href="_s_s_d1306__o_l_e_d_2128x64_2_double_buffer_2_double_buffer_8ino-example.html#_a0">SSD1306_OLED/128x64/DoubleBuffer/DoubleBuffer.ino</a>, <a class="el" href="_s_s_d1306__o_l_e_d_2128x64_2_network_terminal_2_network_terminal_8ino-example.html#_a0">SSD1306_OLED/128x64/NetworkTerminal/NetworkTerminal.ino</a>, <a class="el" href="_s_s_d1306__o_l_e_d_2128x64_2_r_t_clock_2_r_t_clock_8ino-example.html#_a0">SSD1306_OLED/128x64/RTClock/RTClock.ino</a>, <a class="el" href="_s_s_d1306__o_l_e_d_2128x64_2_simple_terminal_out_2_simple_terminal_out_8ino-example.html#_a0">SSD1306_OLED/128x64/SimpleTerminalOut/SimpleTerminalOut.ino</a>, and <a class="el" href="_s_s_d1306__o_l_e_d_2128x64_2_u_i_2_u_i_8ino-example.html#_a0">SSD1306_OLED/128x64/UI/UI.ino</a>.</dd>
</dl>

<p class="definition">Definition at line <a class="el" href="tsi2c_8h_source.html#l00094">94</a> of file <a class="el" href="tsi2c_8h_source.html">tsi2c.h</a>.</p>
</div><hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="tsi2c_8h_source.html">tsi2c.h</a></li>
<li><a class="el" href="tsi2c_8cpp_source.html">tsi2c.cpp</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><b>fabgl</b></li><li class="navelem"><a class="el" href="classfabgl_1_1_i2_c.html">I2C</a></li>
    <li class="footer">Generated on Mon Aug 29 2022 13:52:05 for FabGL by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.3 </li>
  </ul>
</div>
</body>
</html>
